package com.freewater.springboot.demo.ioc.value;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

@Getter
@Component
public class MovieRecommender {

    @Value("#{systemProperties['user.home']}")
    private String userHome; // SpEl

    @Value("#{{'Thriller': 100, 'Comedy': 300}}")
    private Map<String, Integer> countOfMoviesPerCatalog; // SpEl

    private final String catalog;

    public MovieRecommender(@Value("${catalog.name:defaultCatalog}") String catalog) {
        this.catalog = catalog;
    }
}
